package repository

import (
	"context"
	"go-pioneer/internal/repository/dao"
	"go-pioneer/models"
)

type ExampleRepository interface {
	CreateExample(ctx context.Context, example models.Example) error
	GetExample(ctx context.Context, id string) (models.Example, error)
}

type exampleRepository struct {
	dao dao.ExampleDAO
}

func NewExampleRepository(dao dao.ExampleDAO) ExampleRepository {
	return &exampleRepository{
		dao: dao,
	}
}

func (r *exampleRepository) CreateExample(ctx context.Context, example models.Example) error {
	return r.dao.CreateExample(ctx, example)
}

func (r *exampleRepository) GetExample(ctx context.Context, id string) (models.Example, error) {
	return r.dao.GetExample(ctx, id)
}
